<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="utf-8">
  <title>用户管理</title>
  <%- include('./BG_layouts/header.ejs')%>
  <link rel="stylesheet" href="/background/css/client.css">
</head>

<body>
  <script>NProgress.start()</script>

  <div class="main">
    <%- include('./BG_layouts/navbar.ejs') %>
    <div class="container-fluid">
      <div class="page-title">
        <h1>客户管理</h1>

      </div>
      <div class="search">
        <label>搜索</label> <input type="text">
        <ul class="pagination pagination-sm pull-right">
          <li><a href="#">上一页</a></li>
          <li><a href="#">1</a></li>
          <li><a href="#">2</a></li>
          <li><a href="#">3</a></li>
          <li><a href="#">下一页</a></li>
        </ul>
      </div>
      <table class="table table-bordered">

        <thead>
          <tr>
            <th>序号</th>
            <th>姓名</th>
            <th>电话</th>
            <th>性别</th>
            <th>地理位置</th>
            <th>留言</th>
            <th>状态</th>
            <th>操作</th>
          </tr>
        </thead>
        <tbody>
          <script type="text/template" id="client_template">
             {{each list}}
             <tr>
                <td scope="row">{{$value.id}}</td>
                <td>{{$value.name}}</td>
                <td>{{$value.telephone}}</td>
                <td>{{$value.sex}}</td>
                <td>{{$value.site}}</td>
                <td>{{$value.details}}</td>
                {{if $value.status == 1}}
                <td>未签约</td>
                {{/if}}
                {{if $value.status == 2}}
                <td>已签约</td>
                {{/if}}
                <td>
                  <a class="btn btn-danger" role="button" href="#"  data-id='{{$value.id}}'>删除</a>
                  <button data-toggle="modal"   data-toggle="modal"
                   data-target="#gridSystemModal" class="btn btn-warning" role="button" data-id='{{$value.id}}'>修改</button>
                </td>
               </tr>
             {{/each}}
          </script>
        </tbody>
      </table>
      <!-- 修改弹框 -->
      <div id="gridSystemModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="gridModalLabel"
        style="display: none;">
        <div class="modal-dialog" role="document">
          <div class="modal-content">
            <div class="modal-header">
              <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                  aria-hidden="true">×</span></button>
              <h4 class="modal-title" id="gridModalLabel">修改数据</h4>
            </div>
            <div class="modal-body">
              <form class="form">
                <script type="text/template" id='update_template'>
                <div class="form-group">
                    <label for="recipient-name" class="control-label">姓名:</label>
                    <input type="text" name='name' class="form-control" id="recipient-name" value="{{list.name}}">
                  </div>
                  <div class="form-group">
                    <label for="message-text" class="control-label">电话:</label>
                    <input type="text"  name='telephone' class="form-control" id="recipient-name" value="{{list.telephone}}">
                  </div>
                  <div class="form-group">
                    <label for="message-text" class="control-label">性别:</label>
                    <input type="text"  name='sex' class="form-control" id="recipient-name" value="{{list.sex}}">
                  </div>
                  <div class="form-group">
                    <label for="message-text" class="control-label">地理位置:</label>
                    <input type="text"  name='site' class="form-control" id="recipient-name" value="{{list.site}}">
                  </div>
                  <div class="form-group">
                    <label for="message-text" class="control-label">状态:</label>
                    <input type="text"  name='status' class="form-control" id="recipient-name" value="{{list.status}}">
                  </div>
                  <div class="form-group">
                    <label for="message-text" class="control-label">留言:</label>
                    <textarea name='details' class="form-control" id="message-text">{{list.details}}</textarea>
                  </div>
              </form>
            </div>
            <div class="modal-footer">
              <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
              <button type="button" class="btn btn-primary" id="updateBtn" data-id="{{list.id}}">确定</button>
            </div>
          </script>

            </div><!-- /.modal-content -->
          </div><!-- /.modal-dialog -->
        </div>

      </div>
    </div>

    <%- include('./BG_layouts/aside.ejs') %>

    <%- include('./BG_layouts/footer.ejs') %>

    <script src="/background/js/user.js"></script>
</body>

</html>